home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-07-18 | 1.7 KB | 74 lines | [TEXT/MMCC] |
- // yxvals.h values header for C++
- #ifndef _YXVALS_
- #define _YXVALS_
- #ifndef _YVALS
- #include <yvals.h>
- #endif
-
- #if __MWERKS__
- #pragma options align=mac68k
- #endif
-
- // typeinfo description type
- typedef int _Typedesc;
- // type bool
- #if _HAS_BOOL_TYPE
- typedef bool _Bool;
- #else
- typedef int _Bool;
- #endif /* _HAS_BOOL_TYPE */
- // exception macros
- #if _HAS_EXCEPTIONS
- #define _TRY_BEGIN try {
- #define _CATCH_ALL } catch (...) {
- #define _CATCH_END }
- #define _RAISE(x) throw (x)
- #define _RERAISE throw
- #elif _MICROSOFT_EXCEPTIONS
- #define _TRY_BEGIN TRY
- #define _CATCH_ALL CATCH(CException, _PCEx)
- #define _CATCH_END END_CATCH
- #define _RAISE(x) THROW(&(x))
- #define _RERAISE THROW_LAST()
- #else /* no exceptions */
- #define _TRY_BEGIN {{
- #define _CATCH_ALL } if (0) {
- #define _CATCH_END }}
- #define _RAISE(x) xmsg::_Throw(&(x))
- #define _RERAISE xmsg::_Throw(0)
- #endif
- // bitmask macros
- #if _HAS_ENUM_OVERLOADING
- #define _BITMASK(E, T) \
- E& operator&=(E& _X, E _Y) \
- {_X = (E)(_X & _Y); return (_X); } \
- E& operator|=(E& _X, E _Y) \
- {_X = (E)(_X | _Y); return (_X); } \
- E& operator^=(E& _X, E _Y) \
- {_X = (E)(_X ^ _Y); return (_X); } \
- E& operator&(E _X, E _Y) \
- {return ((E)(_X & _Y)); } \
- E& operator|(E _X, E _Y) \
- {return ((E)(_X | _Y)); } \
- E& operator^(E _X, E _Y) \
- {return ((E)(_X ^ _Y)); } \
- E& operator~(E _X) \
- {return ((E)~_X); } \
- typedef E T
- #else
- #define _BITMASK(E, T) typedef int T
- #endif /* _HAS_ENUM_OVERLOADING */
- #define _HAS_PJP_CLIB 1 /* for filebuf/FILE coordination */
-
- #if __MWERKS__
- #pragma options align=reset
- #endif
-
- #endif /* _YXVALS_ */
-
- /*
- * Copyright (c) 1994 by P.J. Plauger. ALL RIGHTS RESERVED.
- * Consult your license regarding permissions and restrictions.
- */
-
-